home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDDTPCS.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  5.4 KB  |  133 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*                                                                       */
  11.  /*   File    : sddtpcs.rul                                               */
  12.  /*                                                                       */
  13.  /*   Purpose : This file contains the code for the SdDiaplayTopics       */
  14.  /*             script dialog function.                                   */
  15.  /*                                                                       */
  16.  /*=======================================================================*/
  17.  
  18.  /*------------------------------------------------------------------------*/
  19.  /*                                                                        */
  20.  /*   Function: SdDisplayTopics                                            */
  21.  /*                                                                        */
  22.  /*   Descrip:  This dialog will display the predefined topics and         */
  23.  /*             corresponding details.                                     */
  24.  /*   Misc:                                                                */
  25.  /*                                                                        */
  26.  /*------------------------------------------------------------------------*/
  27. function SdDisplayTopics( szTitle, szMsg, listTopics, listDetails, nStyle )
  28.           STRING  szDlg, svTopic, svDetail, szTemp;
  29.           NUMBER  nId, nReturn, nCount, nTemp;
  30.           HWND    hwndDlg, hwndDlgItem;
  31.           BOOL    bDone;
  32.         begin
  33.  
  34.            szDlg     = SD_DLG_DISPLAYTOPICS;
  35.            nSdDialog = SD_NDLG_DISPLAYTOPICS;
  36.  
  37.           // record data produced by this dialog
  38.           if (MODE=SILENTMODE) then
  39.             SdMakeName( szAppKey, szDlg, szTitle, nSdDisplayTopics );
  40.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  41.             return nId;
  42.           endif;
  43.  
  44.  
  45.            // ensure general initialization is complete
  46.            if (!bSdInit) then
  47.               SdInit();
  48.            endif;
  49.  
  50.            if (EzDefineDialog( szDlg, "", "", SD_NDLG_DISPLAYTOPICS ) = DLG_ERR) then
  51.              return -1;
  52.            endif;
  53.  
  54.  
  55.            // Loop in dialog until the user selects a standard button
  56.            bDone = FALSE;
  57.  
  58.            while (!bDone)
  59.  
  60.               nId = WaitOnDialog( szDlg );
  61.  
  62.               switch (nId)
  63.               case DLG_INIT:
  64.                    if( szMsg != "" ) then
  65.                        SdSetStatic( szDlg, SD_STA_MSG, szMsg );
  66.                    endif;
  67.  
  68.                    hwndDlg = CmdGetHwndDlg( szDlg );
  69.                    SdGeneralInit( szDlg, hwndDlg, nStyle, szSdProduct );
  70.  
  71.                    nCount = 0;
  72.                    nReturn = ListGetFirstString( listTopics, svTopic );
  73.                    while( nReturn = 0 )
  74.                        hwndDlgItem = GetDlgItem( hwndDlg, SD_STA_TOPIC+nCount );
  75.                        if( hwndDlgItem ) then
  76.                            ShowWindow( hwndDlgItem, TRUE );
  77.                            SdSetStatic( szDlg, SD_STA_TOPIC+nCount, svTopic );
  78.                        endif;
  79.                        nReturn = ListGetNextString( listTopics, svTopic );
  80.                        nCount = nCount + 1;
  81.                    endwhile;
  82.  
  83.                    nCount = 0;
  84.                    nReturn = ListGetFirstString( listDetails, svDetail );
  85.                    while( nReturn = 0 )
  86.                       hwndDlgItem = GetDlgItem( hwndDlg, SD_STA_DETAIL+nCount );
  87.                       if( hwndDlgItem ) then
  88.                           ShowWindow( hwndDlgItem, TRUE );
  89.                           SdSetStatic( szDlg, SD_STA_DETAIL+nCount, svDetail );
  90.                       endif;
  91.                       nReturn = ListGetNextString( listDetails, svDetail );
  92.                       nCount = nCount + 1;
  93.                    endwhile;
  94.  
  95.                    if(szTitle != "") then
  96.                        SetWindowText(hwndDlg, szTitle);
  97.                    endif;
  98.  
  99.               case BACK:
  100.                    nId    = BACK;
  101.                    bDone  = TRUE;
  102.  
  103.               case DLG_ERR:
  104.                    SdError( -1, "SdDisplayTopics" );
  105.                    nId   = -1;
  106.                    bDone = TRUE;
  107.  
  108.               case DLG_CLOSE:
  109.                    SdCloseDlg( hwndDlg, nId, bDone );
  110.  
  111.               default:
  112.                    // check standard handling
  113.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  114.                       bDone = TRUE;
  115.                    endif;
  116.               endswitch;
  117.  
  118.            endwhile;
  119.  
  120.            EndDialog( szDlg );
  121.            ReleaseDialog( szDlg );
  122.  
  123.            SdUnInit( );
  124.  
  125.            // record data produced by this dialog
  126.            SdMakeName( szAppKey, szDlg, szTitle, nSdDisplayTopics );
  127.            SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  128.  
  129.            return nId;
  130.  
  131.         end;
  132.  
  133.